import { connect } from 'react-redux'
import ReceiveHD from '../../../../views/My/MyUtils/Hypothecation/ReceiveHD'

function mapStateToProps(state: any) {
    return {
        userInfo: state.user.userInfo,
        // userHypo: state.user.userHypo,
        userHypoReceiveHD: state.user.userHypoReceiveHD,
        userHypoReceiveHDSold: state.user.userHypoReceiveHDSold,
        userHypoReceiveHDAll: state.user.userHypoReceiveHDAll
    }
}

function mapDispatchToProps(dispatch: (obj: any) => void) {
    return {
        'SET_MYUTILS_HYPOREVEIVEHD': (data: any, type: number) => {
            switch (type) {
                case 1: dispatch({ type: 'SET_MYUTILS_HYPOREVEIVEHD', data }); break
                case 2: dispatch({ type: 'SET_MYUTILS_HYPOREVEIVEHDSOLD', data }); break
                default: dispatch({ type: 'SET_MYUTILS_HYPOREVEIVEHDALL', data }); break
            }
        },
    }
}

export default connect(mapStateToProps, mapDispatchToProps)(ReceiveHD)